﻿Public Class registrar_proveedor
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub BT_atras_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BT_atras.Click
        Response.Redirect("registrar.aspx")
    End Sub

   
    Protected Sub BT_registrar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BT_registrar.Click
        L_mensaje.Visible = True
        BT_aceptar.Visible = True
        BT_cancelar.Visible = True
    End Sub

    Protected Sub BT_aceptar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BT_aceptar.Click
        Dim datacontex As New DCProveedorDataContext
        datacontex.INSERTAR_PROVEEDOR(Val(Me.TB_nit.Text), Me.TB_nombre.Text, Me.TB_direccion.Text, Me.TB_e_mail.Text, Me.TB_contacto.Text, Val(Me.TB_numtel.Text))
        L_mensaje.Visible = False
        BT_aceptar.Visible = False
        BT_cancelar.Visible = False
        L_registro.Visible = True
        BT_registro.Visible = True
        TB_nit.Text = ""
        TB_nombre.Text = ""
        TB_direccion.Text = ""
        TB_e_mail.Text = ""
        TB_numtel.Text = ""
        TB_contacto.Text = ""
        TB_numtel.Text = ""

    End Sub

    Protected Sub BT_cancelar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BT_cancelar.Click
        L_mensaje.Visible = False
        BT_aceptar.Visible = False
        BT_cancelar.Visible = False

    End Sub

    Protected Sub BT_registro_Click(ByVal sender As Object, ByVal e As EventArgs) Handles BT_registro.Click
        BT_registro.Visible = False
        L_registro.Visible = False

    End Sub
End Class